package com.atguigu.eduservice.client;

import com.atguigu.commonutils.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(name = "service-oss",fallback = OssDegradeFeignClient.class)
@Component
public interface OssClient {
    //定义调用方法路径,删除文件
    //@PathVariable一定要写参数名称，否则会出错
    @DeleteMapping("/eduoss/fileoss/delete/{type}/{originalFilename}")
    public R delete(@PathVariable("type") String type, @PathVariable("originalFilename") String originalFilename);

    //删除多个视频
    //参数多个视频url  List videoIdList
    @DeleteMapping("/eduoss/fileoss/delete-bath/{type}")
    public R deleteBatch(@PathVariable("type") String type,@RequestParam("videoIdList") List<String> videoIdList);
}
